import request from '@/utils/request'
import upload from '@/utils/upload'

export function getbasketballTeamList(data) {
	return request({
		url: '/system/basketballTeam/list',
		data: data,
		method: 'get'
	})
}

// 用户头像上传
export function uploadAvatar(data) {
	return upload({
		url: '/system/oss/upload',
		file: data.file
	})
}

export function createbasketballTeam(data) {
	return request({
		url: '/system//basketballTeam',
		data: data,
		method: 'post'
	})
}

export function createbrief(data) {
	return request({
		url: '/system/brief',
		data: data,
		method: 'post'
	})
}

export function getbriefInfo(fileName) {
	return request({
		url: '/system/brief/getInfo',
		method: 'get'
	})
}

export function putbasketballTeam(data) {
	return request({
		url: '/system/basketballTeam',
		data: data,
		method: 'put'
	})
}

export function getImage(fileName) {
	return request({
		url: `/system/oss/preview/${fileName}`,
		method: 'get'
	})
}



export function getInfoBasketballTeam(id) {
	return request({
		url: `/system/basketballTeam/${id}`,
		method: 'get'
	})
}

// 新增教练

export function addCoachList(method,data) {
	return request({
		url: `/system/coach`,
		method,
		data
	})
}


export function getCoachList(data) {
	return request({
		url: `/system/coach/list`,
		method: 'get',
		data
	})
}



export function getCoachListInfo(id) {
	return request({
		url: `/system/coach/${id}`,
		method: 'get',
	})
}


//添加球员
export function addbasketballPlayer(method, data) {
	return request({
		url: `/system/basketballPlayer`,
		method,
		data
	})
}


export function getbasketballPlayerList(data) {
	return request({
		url: `/system/basketballPlayer/list`,
		method: 'get',
		data: data
	})
}

///basketballPlayer/{id}

export function getbasketballPlayerInfo(id) {
	return request({
		url: `/system/basketballPlayer/${id}`,
		method: 'get',
	})
}

///coach/{ids}
export function delcoach(ids) {
	return request({
		url: `/system/coach/${ids}`,
		method: 'delete',
	})
}


export function delbasketballPlayer(ids) {
	return request({
		url: `/system/basketballPlayer/${ids}`,
		method: 'delete',
	})
}

export function delbasketballTeam(ids) {
	return request({
		url: `/system/basketballTeam/${ids}`,
		method: 'delete',
	})
}

//tournament/switchGameSections

export function switchGameSections(data) {
	return request({
		url: `/system/tournament/switchGameSections`,
		method: 'get',
		data,
	})
}

export function postabstention(data) {
	return request({
		url: `/system/tournament/abstention`,
		method: 'get',
		data,
	})
}

export function getTeamGroupingList(data) {
 return request({
  url: '/system/teamGrouping/list',
  data,
  method: 'get',
 })
}


export function getTeanGroupingPlayTeam(data) {
 return request({
  url: '/system/teanGroupingPlayTeam/list',
  data,
  method: 'get',
 })
}

export function createTeamGrouping(data) {
 return request({
  url: '/system/teamGrouping',
  data: data,
  method: 'post'
 })
}

export function createTeanGroupingPlayTeam(data) {
 return request({
  url: '/system/teanGroupingPlayTeam',
  data: data,
  method: 'post'
 })
}

export function delTeanGroupingPlayTeam(ids) {
 return request({
  url: `/system/teanGroupingPlayTeam/${ids}`,
  method: 'delete',
 })
}
export function delteamGrouping(ids) {
 return request({
  url: `/system/teamGrouping/${ids}`,
  method: 'delete',
 })
}
export function putteamGrouping(data) {
 return request({
  url: '/system/teanGroupingPlayTeam',
  data: data,
  method: 'put'
 })
}



export function substitutionPlayer(data) {
 return request({
  url: '/system/playerPositionLog/substitution/player',
  data: data,
  method: 'POST'
 })
}

// system/playerLog/saveBatch

export function setSaveBatch(data) {
 return request({
  url: '/system/playerLog/saveBatch',
  isToast: true,
  data: data,
  method: 'POST'
 })
}

//system/playerLog/listAll
export function getlistAll(data) {
 return request({
  url: '/system/playerLog/listAll',
  data: data,
  method: 'get'
 })
}